package com.jt.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author :Colin
 * @version 创建时间: 2021/8/11 14:15
 */
@RestController
@CrossOrigin
public class PortController {
    //需求:How to get the port dynamically
    @Value("${server.port}")
    private Integer port;

    @GetMapping("/getPort")
    public String getPort(){
        return "当前端口"+port;
    }
}
